import {reqGetSearchInfo} from "@/api";

const state = {
    searchList: {}
};
const actions = {
    async getSearchList({commit}, params = {}) {
        let result = await reqGetSearchInfo(params)
        // console.log(result)
        if (result.code === 200) {
            commit('GET_SEARCH_LIST', result.data)
        }
    },
};
const mutations = {
    GET_SEARCH_LIST(state, searchList) {
        state.searchList = searchList
    },

};
const getters = {
    goodsList(state) {
        return state.searchList.goodsList || []
    },
    trademarkList() {
        return state.searchList.trademarkList || []
    },
    attrsList() {
        return state.searchList.attrsList || []
    },
}

export default {
    state,
    mutations,
    actions,
    getters
};
